fix(api): move focus manifest refresh off GET - #523
Merged
Conversation
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 7c95d0a | Commit Preview URL Branch Preview URL |
Jun 11 2026, 02:43 AM |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
JSONbored
added a commit
that referenced
this pull request
Jun 12, 2026
isRepoFocusManifestPath was anchored at /focus-manifest, so the POST /focus-manifest/refresh route added in #523 was not covered by canSessionAccessPath -- a session-authenticated owner/maintainer was 403'd by the blanket guard before reaching the handler that would have allowed them. Match the optional /refresh sub-path so the route handler's own requireAppRole + requireSessionRepoAccess gate it. Co-authored-by: galuis116 <galuis116@users.noreply.github.com> Co-authored-by: ghost <49853598+JSONbored@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
GET /v1/repos/:owner/:repo/focus-manifestroute previously acceptedrefresh=trueand performed a persisted refresh, which made a state-changing operation reachable from a safe GET and therefore CSRF-vulnerable given browserSameSite=Laxsession cookies.Description
refresh=truequery parameter in theGET /v1/repos/:owner/:repo/focus-manifesthandler so GET now only returns the cached or computed manifest vialoadRepoFocusManifest(c.env, fullName).POST /v1/repos/:owner/:repo/focus-manifest/refreshendpoint that performs an explicit cache refresh by callingloadRepoFocusManifest(..., { refresh: true })and reuses the same role and repo-access checks.POSTrefresh path.test/unit/routes-focus-manifest.test.tsto assert thatGET ?refresh=trueno longer refreshes the persisted cache and that the newPOST .../refreshendpoint does perform refreshes.Testing
npx vitest run test/unit/routes-focus-manifest.test.ts test/unit/focus-manifest-loader.test.ts, and all tests passed.npm run typecheck, which completed successfully.Codex Task